<style type="text/css">
    img{
        padding: 0px !important;
        border: 0 !important;
    }
</style>
<div class="index_topout">
    <div class="index_inouttop" <?php if (!$view->isLogined) { ?> style="width: 770px;margin: 20px;"<?php } ?>>
        <form method="post" id="submit-answer-form" enctype="multipart/form-data">
        <?php if ($view->isLogined) { ?>
        
        <div class="index_inintop" style="height: 245px;">
            <?php if ($view->isCommented) { ?>
            <div class="index_inintitle">Your contribution has been registered</div>     
            <?php } else { ?>
            <div class="index_inintitle">&nbsp;</div>                 
            <?php } ?>
            <div style="margin-top: -5px;" class="index_inintitle2">Why we should win?</div>
            <textarea <?php if ($view->isCommented) { ?> disabled="disabled" readonly="readonly" <?php } ?> name="data[answer_text1]" class="index_formtextarea"><?php echo str_replace("\\'", "'", nl2br($view->commentData['answer_text1'])); ?></textarea>
            
            <br/>
            <div class="index_inintitle2">Upload an image of you and your fiance</div> 
            <div class="index_formtextarea" style="height: auto;">
            <?php if (!$view->isCommented) { ?>
            <input type="file" name="answer_text2" />
            <?php } else { ?>
            <a class='iimage' href="<?php echo $view->commentData['answer_text2'];?>" title="<?php echo $view->commentData['answer_text1'];?>">
                View image
            </a>
            <!-- <img src="<?php echo $view->commentData['answer_text2'];?>" /> -->
            <?php } ?>
            </div>
            <div style="margin:-10px 0 0 322px;">
                <img style="cursor: pointer;" onclick="jQuery('#submit-answer-form').submit();" src="<?php echo $view->config['template_url']; ?>html/images/submit.png" width="109" height="35">
            </div>
        </div>
        <div class="index_formrightpanel"> 
            <div style="float:left;clear:both;width:100%">
                <div style="float:left;margin:36px 0 0 17px;">
                    <div class="index_formprofilename">
                        Hi <a target="_blank" href="http://www.facebook.com/profile.php?id=<?php echo $view->user['facebook_user_id']; ?>">
                        <?php echo $view->user['name']; ?>
                        </a>
                    </div>
                    <a target="_blank" href="http://www.facebook.com/profile.php?id=<?php echo $view->user['facebook_user_id']; ?>">
                        <img src="http://graph.facebook.com/<?php echo $view->user['facebook_user_id'];?>/picture/?type=large" width="123" height="117" >
                    </a>
                </div>
                <div style="float:left" >
                    <div style="float:left;clear:both;margin:31px 0 0 9px;">                    
                        <a href="javascript:facebooktab.share();"><img src="images/facebook_button.png" style="width: 60px;" /></a>
                        <?php 
                            $likeURL = $view->config['lightbox_like_url'] . "&data_id=" . $view->commentData['data_id'];                    
                        ?>
                        <iframe src="//www.facebook.com/plugins/like.php?href=<?php echo urlencode($likeURL); ?>&amp;send=false&amp;layout=button_count&amp;width=90&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=20" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:20px;" allowTransparency="true"></iframe>

                    </div>                                            
                </div>
                    
            </div> 
        </div>    
        
        <?php } else { ?>   
        <?php 
        echo str_replace("[connect_to_facebook]", '<a href="javascript:contestapp.loginFacebook();"><img style="vertical-align: middle;" src="layouts/images/connec-to-fb.png" alt="Connect to facebook" /></a>', nl2br(str_replace("\\\"", "\"", $view->contest['signup_tab_text'])));
        ?>        
            <br/>   
            <br/>   
    <?php } ?>
        </form>
    </div>
</div>
<div style="float:left;clear:both;width:810px;min-height:40px;background-color:#b41b20;">
     <div style="margin: 9px auto 0px; width: 300px;">
       <iframe src="//www.facebook.com/plugins/like.php?href=<?php echo urlencode($view->config['facebooktab_share_url']); ?>&amp;send=false&amp;layout=button_count&amp;width=90&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=20" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:20px;vertical-align: middle;" allowTransparency="true"></iframe>                                            
       <!-- Place this tag where you want the +1 button to render. -->
       <div style="vertical-align:middle;display: inline-block;margin-left: -10px;">
           <div class="g-plusone" data-size="medium" data-href="<?php echo $view->config['facebooktab_share_url']; ?>"></div>
       </div>     
       <div style="vertical-align:middle;display: inline-block;margin-left: -20px;">
        <a href="https://twitter.com/share" class="twitter-share-button" data-url="<?php echo $view->config['facebooktab_share_url']; ?>">Tweet</a>
       </div>
        <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
    <!-- Place this tag after the last +1 button tag. -->
    <script type="text/javascript">
      window.___gcfg = {lang: 'no'};

      (function() {
        var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
        po.src = 'https://apis.google.com/js/plusone.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
      })();
    </script>
    </div>
</div>

<script type="text/javascript">
    // set up share data
    facebooktab.setFacebookShareData({
        picture:'<?php echo $view->contest['share_image']; ?>',
        name:'<?php echo $view->contest['share_title']; ?>',
        caption:'<?php echo $view->contest['share_text']; ?>',
        url:'<?php echo $view->config['facebooktab_share_url'] . "&app_data=" . $view->commentData['data_id']; ?>',
        actionText:'<?php echo $view->contest['share_action_text']; ?>'
    });
</script>
